1. Field of the Invention
The present invention relates to storage of a complex data structure such as an array within storage media having a defined structure, for example a database table or an extensible markup language (XML) document.
2. Description of the Related Arts
Storage of information within a storage medium requires establishment of a prescribed storage definition for the storage medium. The storage definition for the storage medium enables the information to be stored and retrieved from the storage medium according to prescribed routines based on the storage definition. Such storage definitions may include specifying a definition for a data entry, where the data entry includes a unique identifier usable by an index for searching (i.e., a key), and a corresponding data entry value. For example, a database such as an LDAP database has prescribed storage definitions that enable external processes to access the database. Similarly, an extensible markup language (XML) document may be defined by prescribed XML tags that specify the data to be stored.
FIG. 1 is a diagram illustrating a conventional XML document 10 configured for storing information according to a prescribed storage definition. The XML document 10 includes XML tags 12 that specify the storage definition for the information to be stored. For example, the XML tags 12a and 12e define the boundaries of the XML document 10 having the title xe2x80x9cUSER ENTRYxe2x80x9d. The XML tags 12b, 12c and 12d each specify a data entry having an element name 14 and the corresponding element value 16. Each XML tag 12 also specifies a prescribed data type 18. Hence, an XML parser can recognize that the data field xe2x80x9cUser Addressxe2x80x9d 14b is an address-type entry having a value of xe2x80x9c1234 Generic Road, Anytown, Va. USA 23232xe2x80x9d. Hence, the XML document 10 provides a data structure that enables the storage and retrieval of information according to the prescribed storage definitions specified within the XML document 10 and as implied by the syntax of the XML language.
A fundamental problem with the storage of information within a rigidly defined storage medium, such as in an XML document or a database, is that the addition of a complex structure such as an array requires a change in the existing storage definition. For example, the data element xe2x80x9cUser Addressxe2x80x9d 14b specifies an address value of xe2x80x9c1234 Generic Road, Anytown, Va. USA 23232xe2x80x9d. Assume, however, that a new use of the existing data structure 10 requires storage of the address value as a structured array 20, as illustrated in FIG. 2, where the address value 16b needs to be redefined as an array 22 having a plurality of separate array elements 24 instead of the single string 16b. In particular, the element 24a specifies the name (xe2x80x9cUser Addressxe2x80x9d) of the array 22, and each of the elements 24b, 24c, 24d, 24e, and 24f specify an element name 26 usable as a key and a corresponding element value 28. Although the array 22 has the advantage of enabling indexed searching on any one of the elements 24, the array 22 cannot be stored within the XML document 10 according to conventional techniques. Hence, the array 22 cannot be stored without modification to the existing structure of the XML document 10 unless the element values 28 within the array 22 are extracted and combined to form the string 16b, resulting in a loss of the searchable element names 26.
There is a need for an arrangement that enables a complex data structure to be stored within a storage medium according to a prescribed storage definition, without modification of the prescribed storage definition or removal of structural components of the complex data structure.
There is also a need for an arrangement that enables an array having a prescribed data structure to be stored within a single data field having a prescribed storage definition in a manner that enables the array to be recovered from the single data field.
These and other needs are attained by the present invention, where an executable process, configured for storing and retrieving data from a storage medium having a prescribed storage definition, is configured for converting an array having a prescribed data structure into a string having array descriptors that specify the prescribed data structure, enabling the array to be stored and recovered from the storage medium without modification of the prescribed storage definition.
According to one aspect of the present invention, a method is provided in a executable system configured for storing information onto a tangible medium according to a prescribed storage definition. The method includes generating a string based on an array, having a prescribed data structure and having the information stored in the array according to the prescribed data structure, by including within the string the information and array descriptors that specify the prescribed data structure. The method also includes storing the string into a data field on the tangible medium according to the prescribed storage definition. The inclusion of array descriptors within the string and that specify the prescribed data structure enables the array structure to be preserved during storage into the data field according to the prescribed storage definition. Hence, a retrieval process may regenerate the array from the string stored in the data field, based on the stored array descriptors. Hence, a complex structure such as an array can be stored in a storage medium having a prescribed storage definition, without loss of the array structure or modification to the prescribed storage definition.
Another aspect of the present invention provides a processor-based system configured for storing information onto a tangible medium according to a prescribed storage definition. The system includes a storage interface process configured for converting an array, having a prescribed data structure and information stored according to the prescribed data structure, into a string including the information and array descriptors that specify the prescribed data structure. The system also includes a storage process configured for storing the string into a data field on the tangible medium according to the prescribed storage definition.
Additional advantages and novel features of the invention will be set forth in part in the description which follows and in part will become apparent to those skilled in the art upon examination of the following or may be learned by practice of the invention. The advantages of the present invention may be realized and attained by means of instrumentalities and combinations particularly pointed out in the appended claims.